]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Fix race condition causing stuck notification banners
authoreveryx <lunt.luo@gmail.com>
Sat, 13 Sep 2025 04:01:17 +0000 (12:01 +0800)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 13 Sep 2025 17:04:54 +0000 (19:04 +0200)
A race condition can occur where a notification banner gets stuck on screen
and never disappears.

This happens when a new notification needs to be shown while an old one
is in the middle of its hiding animation. The process to show the new
notification calls `remove_all_transitions()`, which forcefully stops
the hiding animation of the old one.

The cleanup logic, which destroys the old banner actor, was located in
the `onComplete` handler of the animation. Since the animation was
interrupted and not completed, this handler was never called, leaving a
"zombie" banner on screen.

To fix this, the call to the cleanup function is moved from the
`onComplete` handler to an `onStopped` handler. This handler is
guaranteed to be called whenever an animation stops, regardless of
whether it finished successfully or was interrupted. This ensures the
banner is always cleaned up correctly.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6006
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3861>
(cherry picked from commit 93a79cf61b2b404357e6f637cc9e7f324fb27a69)

js/ui/messageTray.js

index 30502bfe10348e2bfb4617d4051c2817b76ead26..f9f9bbf39cec21f8e6b577821ca24d2a6e331ed6 100644 (file)
@@ -1250,7 +1250,7 @@ export const MessageTray = GObject.registerClass({
             y: -this._bannerBin.height,
             duration,
             mode: Clutter.AnimationMode.EASE_OUT_BACK,
-            onComplete: () => {
+            onStopped: () => {
                 this._notificationState = State.HIDDEN;
                 this._hideNotificationCompleted();
                 this._updateState();